{% extends "admin/base_site.html" %}
{% load i18n %}
{% block extrastyle %}
  {{ media }}
{% endblock %}

{% block bodyclass %}change-list{% endblock %}

{% block content %}
	{% if not message_404 %}
		<h1> Add {{ model_name|title }} </h1>
	
		{% if message %} <p> {{ message }} </p> {% endif %}
		<form method="POST" action="." >
			{% csrf_token %}
			{{ form.as_p }}
			<p> <input type="submit" value="Adicionar" /></p>
		</form>
		{% if results_list %}
			<table>
			<thead>
				<tr>
					<td> {{ model_name|title }}</td>
					<td> Edit </td>
					<td> Delete </td>
				</tr>
			</thead>
			<tbody>
				{% for result in results_list %}
					<tr>
						<td> {{ result }} </td>
						<td> <a href="{{ result.id }}/">Edit</a></td>
						<td> <a href="{{ result.id }}/?action=delete">Delete</a></td>
					</tr>
				{% endfor %}	
			</tbody>
			</table>
			{% if is_paginated %}
				{% include "admin/real_estate_app/navigation.html" %}
			{% endif %}
		{% else %}
			{% trans "Your list is empty" %}
		{% endif %}
	{% else %}
		<h1> {{ message_404 }} </h1> 
		<p> <a href="../"> volte para página anterior </a> </p>
	{% endif %}
{% endblock %}
